package com.panda.mall.common.mallOrder.feign;

import com.panda.mall.common.mallOrder.entity.MallOrder;
import com.panda.mall.common.mallWares.entity.MallGoodsCategory;
import com.panda.mall.common.result.Result;
import feign.hystrix.FallbackFactory;

import java.util.List;

/**
 * author: tcy
 * createDate: 2023/2/3
 * description:订单降级处理
 */
public class OrderFallbackFactory implements FallbackFactory<OrderFeign> {

    @Override
    public OrderFeign create(Throwable throwable) {

        return new OrderFeign() {

            /**
             * 查询订单
             * @return
             */
            @Override
            public Result<List<MallOrder>> queryOrders() {
                return Result.fail(null);
            }

            /**
             * 按id查询订单
             * @param id
             * @return
             */
            @Override
            public Result<MallOrder> queryOrderById(Long id) {
                return Result.fail(null);
            }
        };

    }
}
